<?php

namespace App\Models;
use DateTimeInterface;
use Illuminate\Database\Eloquent\Model;

//模型基类
abstract class BaseModel extends Model
{
    //获取表名
    public static function tableName(): string
    {
        return (new static())->getTable();
    }

    //格式化时间
    protected function serializeDate(DateTimeInterface $date): string
    {
        return $date->format('Y-m-d H:i:s');
    }

}
